package com.davidhigenbottam.HeatMap.shared;

import com.davidhigenbottam.HeatMap.data.InstitutionData;
import com.davidhigenbottam.HeatMap.data.ProvinceData;

public class ServerResults {

	private ProvinceData provinceData;
	private InstitutionData institutionData;	
	private Results results;
	
	public ServerResults(ProvinceData pd, InstitutionData id) {
		
		this.provinceData= pd;
		this.institutionData= id;
	}
	
	
	
	public ProvinceData getProvinceData() {
		return provinceData;
	}
	public void setProvinceData(ProvinceData provinceData) {
		this.provinceData = provinceData;
	}
	public InstitutionData getInstitutionData() {
		return institutionData;
	}
	public void setInstitutionData(InstitutionData institutionData) {
		this.institutionData = institutionData;
	}
	public Results getResults() {
		if(this.results==null){
			
			Results res= new Results();
			
			if(provinceData!=null)
				res.setProvinces(provinceData.getList());

			if(institutionData!=null){
				res.setInstitutions(institutionData.getList());
				res.setInstitutionsMaxVal(institutionData.getMaxVal());
				res.setInstitutionsMinVal(institutionData.getMinVal());
			}
			this.results= res;
		}
		return results;
	}
	public void setResults(Results results) {
		this.results = results;
	}
	
	
	
}
